package cs275.ants.graph.base;

import java.io.Serializable;

import com.google.common.base.Objects;

public class GraphEdge implements Serializable {
	
	/**
	 * Serialization ID
	 */
	private static final long serialVersionUID = 2L;
	
	private double cost; 
	private GraphVertex node1; 
	private GraphVertex node2; 
	
	public GraphEdge(GraphVertex node1, GraphVertex node2) {
		this(node1, node2, 1);
	}
	
	public GraphEdge(GraphVertex node1, GraphVertex node2, double cost) {
		this.cost = cost;
		this.node1 = node1;
		this.node2 = node2;
	}

	public double getCost() {
		return cost;
	}

	public void setCost(double cost) {
		this.cost = cost;
	}

	public GraphVertex getNode1() {
		return node1;
	}

	public void setNode1(GraphVertex node1) {
		this.node1 = node1;
	}

	public GraphVertex getNode2() {
		return node2;
	}

	public void setNode2(GraphVertex node2) {
		this.node2 = node2;
	}
	
	@Override
	public String toString() {
		return Objects.toStringHelper(this)
			.add("node1", node1)
			.add("node2", node2)
			.add("cost", cost)
			.toString();
	}
}
